<?php
$pageCss = array('home');
$this->load->view('header',array('modules'=>$modules,'pageTitle'=>'首页', 'pageCss'=>$pageCss));?>
	<div class="container">
      <div class="main">
      	<div class="main-top">
      		<?php if (isset($top[0])):?>
            <div class="top-left">
	            <a target="_blank" href="<?php echo site_url('p/'.$top[0]['id']);?>" class="img-top-left">
	                <img src="<?php echo site_url().$top[0]['logo'];?>" />
	                <span class="top-title"><?php echo $top[0]['title'];?></span>
	             </a>
            </div>
            <?php endif;?>
          <div class="top-right">
          <?php if (isset($top[1])):?>
          	<div class="right-t">
                <a target="_blank" href="<?php echo site_url('p/'.$top[1]['id']);?>" class="img-right">
                <img src="<?php echo site_url().$top[1]['logo'];?>" />
                <span class="right-title"><?php echo $top[1]['title'];?></span>
                </a>
            </div>
            <?php endif;?>
            <?php if (isset($top[2])):?>
             <div class="right-b">
                <a target="_blank" href="<?php echo site_url('p/'.$top[2]['id']);?>" class="img-right">
                <img src="<?php echo site_url().$top[2]['logo'];?>" />
                <span class="right-title"><?php echo $top[2]['title'];?></span>
                </a>
              </div>
              <?php endif;?>
            </div>
          </div>
          <!--<div class="t-text"><a href="#">不喜欢？换一批>></a></div>-->
          <div class="content">
            	<div class="content-wrapper">
                	<h2 class="lastest">latest news</h2>
                    <ul>
                    	<?php if (!empty($result['result'])): foreach ($result['result'] as $article):?>
	                    <li>
	                    	<div class="left-col">
		                    	<a class="img" target="_blank" href="<?php echo site_url('p/'.$article['id']);?>">
		                    		<img class="wp-post-image" title="" alt="" src="<?php $imgUrl = isset($article['logo']) ? getThumbFile($article['logo']) :''; echo site_url().$imgUrl;?>">
		                    	</a>
	                    	</div>
	                    	<div class="right-col">
	                    	<p class="name">
	                    		<a target="_blank" href="<?php echo site_url('p/'.$article['id'])?>"><?php echo $article['title'];?></a>
	                    	</p>
	                    	<p class="ugc">
	                    		<?php $num = mb_strlen($article['summary'], 'utf-8');echo $num>60 ? mb_substr($article['summary'], 0, 60, 'utf-8') . '...' : $article['summary']; ?>
	                    	</p>
	                    	</div>
	                    	<!-- 
		                    <div class="share">
		                    	<em class="time"><?php echo date('m-d', $article['created_at']);?></em>
		                    	<a class="share-btn" href="javascript:void(0)">
				                	<img src="<?php echo base_url()?>images/zhuanfa.png">
				                </a>
				                <span>
				                	<i class="share-heart"><img src="<?php echo base_url()?>/images/good.png"></i>
				                	<a href="#">17</a>
				                </span>
			                </div>
			                 -->
	                    </li>
                    	<?php endforeach; endif;?>
                    </ul>
                    <div class="fenye">
		                <?php if (isset($result['pager'])):?>
		                <p class="page">
		                <?php echo $result['pager']->create_links();?>
		           		<?php endif;?>
	                </div>
                </div>
          </div>
          <div class="aside">
            	<div class="aside-tags">
                <h2>Feature Tags</h2>
                <ul>
                	<?php if (!empty($categories)): foreach ($categories as $cate):?>
	                  <li><i class="new"></i><a href="<?php echo site_url('/category/'.$cate['id']);?>" target="_blank"><?php echo $cate['name'];?> </a></li>
                  	<?php endforeach; endif;?>
                </ul>
                </div>
                <div class="aside-social">
            		<p>微信公众平台：ieelab 或扫下方二维码：</p>
                     <div class="qrcode"><img src="<?php echo site_url()?>images/qrcode.jpg" alt="Qrcode" /></div>
            	</div>
          </div>
       </div>
       <div class="main-right">
          <a href="#">
            <img width="280" height="250" alt="" src="<?php echo site_url()?>/public/image003.jpg" /> 
           </a>
           <div class="hot-article">
           	<h3 class="t-h2">
            <em>热门文章</em>   
            </h3>
            <ul>
	            <?php if (!empty($hot)): foreach ($hot as $hotArticle):?>
		            <li class="view-list">
		            	<h4><a target="_blank" href="<?php echo site_url('p/'.$hotArticle['id'])?>"><?php echo $hotArticle['title'];?></a></h4>
		            </li>
	            <?php endforeach;endif;?>
            </ul>
           <div class="wonderful-comment">
           	<h3 class="t-h2">
            <em>精彩评论</em>   
            </h3>
            <?php if (!empty($comments)): foreach ($comments as $comment):?>
            <div class="view-list">
            	<div class="postmeta"><?php echo isset($comment['username'])? $comment['username']:'匿名用户';?>•<?php echo cltime($comment['created_at'])?> </div>
                <div class="sidebar-comments"><?php echo $comment['content'];?> </div>
             </div>
			<?php endforeach; endif;?>
             </div>
          </div>
    </div>
    </div>
<?php $this->load->view('footer');?>